<%--
  Created by IntelliJ IDEA.
  User: 刘洋
  Date: 2019/10/15
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>Title</title>
	<jsp:include page="${pageContext.request.contextPath}/layout/_imports.jsp"></jsp:include>
	<script>
        function verifyPwd() {
            var pwd = document.getElementById("pwd").value;
            var rePwd = document.getElementById("rePwd").value;
            if (pwd == rePwd) {
                return true;
            }
            $("#error").html("error");
            return false;
        }
	</script>
</head>
<body>
<jsp:include page="/layout/_nav.jsp"></jsp:include>
<form action="${pageContext.request.contextPath}/user" method="post" style="margin: 0 auto;width:600px;
text-align: center;padding-top:15%;">
	<input type="hidden" name="state" value="u.register">
	<div style="width: 100%; height: 100%;">
		<div class="row">
			<div class="col col-sm-4" style="text-align: right;color: black;">用户名:</div>
			<div class="col col-sm-8"><input class="form-control" id="uName" type="text" name="username"></div>
		</div>
		<div class="row">
			<div class="col col-sm-4" style="text-align: right;color: black;">密码:</div>
			<div class="col col-sm-8"><input class="form-control" id="pwd" type="password" name="password"></div>
		</div>
		<div class="row">
			<div class="col col-sm-4" style="text-align: right;color: black;">确认密码:</div>
			<div class="col col-sm-8"><input class="form-control" id="rePwd" type="password"></div>
		</div>

		<div id="error">${error}</div>
		<input class="btn btn-dark" style="margin-left:20px;margin-top: 10px;" type="submit" value="OK"
		       onclick="return verifyPwd()">
		<a href="login.jsp" class="btn btn-dark" style="margin-left:100px;margin-top: 10px;">back</a>
	</div>
</form>
</body>
</html>
